home *** CD-ROM | disk | FTP | other *** search
- Path: news.informatik.uni-muenchen.de!usenet
- From: watzka <watzka@stat.uni-muenchen.de>
- Newsgroups: comp.lang.c
- Subject: Re: need for function prototypes
- Date: Tue, 27 Feb 1996 17:40:33 +0100
- Organization: Institut fⁿr Statistik
- Message-ID: <31333401.7D03@stat.uni-muenchen.de>
- NNTP-Posting-Host: pc9.stat.uni-muenchen.de
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (WinNT; I)
-
- Chris Rossall wrote:
- >
- > Hello I am having trouble understanding why I should use function
- > prototypes. I mean,if the function is defined before it is used,the
- > compiler should have enough information about the parameters to
- > produce correct code anyway.
-
- Yes, indeed, a function definition provides enough information to
- produce correct code. If your function returns an int and has no
- variable argument list, correct code can be produced without a
- function prototype.
-
- Function prototypes are useful for _checking_ code, esp. in situations
- where the first call to a function in a translation unit will precede
- the definition of that function.
-
- Kurt
-